package com.salon.modules.makeup.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.salon.common.http.response.PageResult;
import com.salon.modules.makeup.mapper.BannerMapper;
import com.salon.modules.makeup.entity.BannerEntity;
import com.salon.modules.makeup.service.BannerService;
import com.salon.common.utils.Query;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;
import java.util.Map;

/**
 * 横幅表
 *
 * @author lch 12345678@qq.com
 * @since 1.0.0 2023-10-08
 */
@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, BannerEntity> implements BannerService {

    @Override
    public PageResult<BannerEntity> listBannerByPage(Map<String, Object> params) {
        IPage<BannerEntity> page = new Query<BannerEntity>().getPage(params);
        IPage<BannerEntity> list = baseMapper.listBannerByPage(page, params);
        return new PageResult<>(list.getTotal(), list.getCurrent(), list.getSize(), list.getRecords());
    }

    @Override
    public List<BannerEntity> listBanner(Map<String, Object> param) {
        return baseMapper.listBanner(param);
    }

}